package com.fwamgic.controller;

import com.fwmagic.spi.UserProperties;
import com.fwmagic.spi.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @description:
 * @author: fangw
 * @Date: 2023/2/6
 **/
@RestController
@RequestMapping("/user")
public class UserController {
    @Autowired
    private UserService userService;

    @GetMapping("/getUserInfo")
    public String getUserInfo() {
        UserProperties user = userService.getUser();
        String msg = String.format("user is %s,age is %s", user.getName(), user.getAge());
        return msg;
    }
}
